package com.dynamicallo.ty.test;

import java.util.List;

import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.dynamicallo.ty.dao.ActionMapper;
import com.dynamicallo.ty.entity.Action;
import com.dynamicallo.ty.entity.Content;
import com.dynamicallo.ty.service.IContentService;
import com.dynamicallo.ty.service.IInterbaleService;

/**
 * 专门测试mybatis的mapper是否OK
 * @author wb
 * @date 2016年1月2日 下午9:01:53
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:spring-mybatis.xml")
//@ContextConfiguration(locations={"classpath*:spring-mybatis.xml", "classpath*:applicationContext.xml"})
public class test2 {
    @Autowired
    private ActionMapper actionMapper;
    @Test
    public void testGetAllContent(){
        List<Action> actions =actionMapper.getAllAction();
        for(Action Action:actions){
            System.out.println(Action);
        }
        
        System.out.println("输出成功");
    }
    @Test
    public void testgetAllActionsByContentId(){
        List<Action> actions =actionMapper.getAllActionByContentId(1);
        for(Action Action:actions){
            System.out.println(Action);
        }
        
        System.out.println("输出成功");
    }
    
    
    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath:applicationContext.xml"); 
        System.out.println("输出成功");
    }
}

